home *** CD-ROM | disk | FTP | other *** search
/ Clinical Endocrinology / Clinical Endocrinology.iso / mac / 00000000 / 06000000 / Shared.dir / 00907_Script_907 next >
Text File  |  1995-11-17  |  1KB  |  38 lines

  1. -- handler to animate a button. Put the number of frames
  2. -- to use to animate (i.e. how many castmembers) into 
  3. -- "theCast". Put the length of delay between frames 
  4. -- required in clicks into "theClicks".
  5. -- Make sure the cast members are arranged sequentially
  6. -- in the cast window.
  7.  
  8. on animate theCast, theClicks
  9.   
  10.   -- put sound instruction here
  11.   sound playFile 1, "Click.aif"
  12.   put the clickOn into whichChannel
  13.   put the castNum of sprite whichChannel into whichCast
  14.   set i = whichCast + 1
  15.   
  16.   repeat while i < ( whichCast + theCast) 
  17.     
  18.     set the castNum of sprite whichChannel = i
  19.     updateStage
  20.     wait theClicks
  21.     set i = i + 1
  22.     
  23.   end repeat
  24.   
  25.   set the castNum of sprite whichChannel = whichCast
  26.   updateStage
  27.   
  28. end animate
  29.  
  30. ---------------------------------------------------
  31. -- handler to create a pause
  32.  
  33. on wait theClicks
  34.   put the timer into theTime
  35.   repeat while the timer < ( theTime + theClicks )
  36.   end repeat
  37. end wait
  38. --------------------------------------------------